package com.crm.controller.hy;

import com.crm.utils.R;
import com.crm.vo.RetrieveVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.sql.Timestamp;
import java.util.Date;

/**
 * 回收站
 */
@Api(value = "回收站",tags = "回收站api")
@Controller
@RequestMapping("/retrieve")
public class RetrieveController {

    R r=new R();

    @RequestMapping(value = "/findRetrieveList", method = RequestMethod.GET)
    @ApiOperation(value = "查询所有的回收站信息", notes = "查询所有的回收站信息", httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true)
    })
    @ResponseBody
    public R findRetrieveList(Integer currentPage,Integer pageSize){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @RequestMapping(value = "/findRetrieveByDay", method = RequestMethod.GET)
    @ApiOperation(value = "查询今日删除", httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true)
    })
    @ResponseBody
    public R findRetrieveByDay(Integer currentPage,Integer pageSize){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }
    @GetMapping("/findRetrieveByWeek")
    @ApiOperation(value = "查询本周删除", httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true)
    })
    @ResponseBody
    public R findRetrieveByWeek(Integer currentPage,Integer pageSize){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @GetMapping("/findRetrieveByMouth")
    @ApiOperation(value = "查询本月删除", httpMethod = "GET", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true)
    })
    @ResponseBody
    public R findRetrieveByMouth(Integer currentPage,Integer pageSize){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }
    @PostMapping("/findRetrieveListByValue")
    @ApiOperation(value = "通过条件查询所有的回收站", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "value", value = "客户名称，联系人，手机号码", paramType = "query", dataType = "String", required = true)

    })
    @ResponseBody
    public R findRetrieveListByValue(Integer currentPage,Integer pageSize,String value){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @PostMapping("/findRetrieveByDayAndValue")
    @ApiOperation(value = "按条件查询今日删除", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "value", value = "客户名称，联系人，手机号码", paramType = "query", dataType = "String", required = true)

    })
    @ResponseBody
    public R findRetrieveByDayAndValue(Integer currentPage,Integer pageSize,String value){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @PostMapping("/findRetrieveByWeekAndValue")
    @ApiOperation(value = "按条件查询本周删除", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "value", value = "客户名称，联系人，手机号码", paramType = "query", dataType = "String", required = true)

    })
    @ResponseBody
    public R findRetrieveByWeekAndValue(Integer currentPage,Integer pageSize,String value){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @PostMapping("/findRetrieveByMouthByValue")
    @ApiOperation(value = "按条件查询本月删除", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页码数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示记录数", paramType = "query", dataType = "int", required = true),
            @ApiImplicitParam(name = "value", value = "客户名称，联系人，手机号码", paramType = "query", dataType = "String", required = true)

    })
    @ResponseBody
    public R findRetrieveByMouthByValue(Integer currentPage,Integer pageSize,String value){
        RetrieveVo retrieveVo=new RetrieveVo(1,"张三","删除原因",new Date(),"张三",100);
        return r.okR(retrieveVo);
    }

    @PostMapping("/returnC")
    @ApiOperation(value = "还原被删除的客户", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customerIds", value = "客户id集合",required = true)

    })
    @ResponseBody
    public R returnC(Integer[] customerIds){
        return r.ok();
    }

    @PostMapping("/returnSea")
    @ApiOperation(value = "把客户转入公海", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customerIds", value = "客户id集合",required = true)

    })
    @ResponseBody
    public R returnSea(Integer[] customerIds){
        return r.ok();
    }

    @PostMapping("/delRetrieve")
    @ApiOperation(value = "把客户彻底删除", httpMethod = "POST", response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "customerIds", value = "客户id集合",required = true)

    })
    @ResponseBody
    public R delRetrieve(Integer[] customerIds){
        return r.ok();
    }
}
